package org.example.service;


import org.example.ResultMap;
import org.example.User;

import org.example.config.MyFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 面向接口编程
 */
@Service
@FeignClient(name = "EUREKA-CLIENT", fallbackFactory = MyFeignClientFallbackFactory.class) //服务提供者的服务名称
public interface FeignService {
    @RequestMapping("/provider/service1/{name}/{age}")
        //服务提供者的接口地址
    ResultMap<User> getUserMap(@PathVariable("name") String name,
                               @PathVariable("age") int age);


}
